package net.koodar.forge.business.category.manager;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.koodar.forge.business.category.dao.CategoryAttributeValueMapper;
import net.koodar.forge.business.category.model.entity.CategoryAttributeValue;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author liyc
 */
@Service
public class CategoryAttributeValueManager extends ServiceImpl<CategoryAttributeValueMapper, CategoryAttributeValue> {

    public List<CategoryAttributeValue> findByAttributeIds(List<Long> attributeIdList) {
        return baseMapper.selectList(Wrappers.<CategoryAttributeValue>lambdaQuery().in(CategoryAttributeValue::getAttributeId, attributeIdList));
    }

    public List<CategoryAttributeValue> findByAttributeId(Long attributeId) {
        return baseMapper.selectList(Wrappers.<CategoryAttributeValue>lambdaQuery().eq(CategoryAttributeValue::getAttributeId, attributeId));
    }
}
